<template>
  <div class="container">
    <topTitle
      :titleText="projectName"
      :back="true"
      :status="statusDesc"
      :titleExplain="
        loginType == 'JC'
          ? '修改部分信息将影响部分统计数值，修改后待24小时后查看最新统计。'
          : ''
      "
      @gobackTriser="goBackOne"
    >
    </topTitle>
    <div
      class="mainCon"
      :class="loginType == 'JC' ? 'mainCon mainConeditTips' : 'mainCon '"
    >
      <el-form
        :model="formData"
        :rules="formRules"
        ref="formData"
        label-width="164px"
        class="demo-ruleForm"
      >
        <el-row>
          <el-col>
            <div class="secondaryTitle secondaryTitleTheme mrB30">
              项目基本信息
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <div class="grid-content bg-purple" v-if="loginType == 'JC'">
              <el-row>
                <el-col :span="12">
                  <el-form-item prop="projectName" label="项目名称：">
                    <el-input
                      v-model.trim="formData.projectName"
                      placeholder="请输入项目名称"
                      class="proInputWidth"
                      clearable
                    ></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item prop="areaId" label="所属区域：">
                    <el-cascader
                      v-model="areaId"
                      :options="areasOptions"
                      @change="getAreaId"
                      clearable
                      filterable
                      placeholder="请选择"
                      class="proInputWidth"
                    ></el-cascader>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="12">
                  <el-form-item prop="industryId" label="所属行业：">
                    <el-select
                      clearable
                      filterable
                      placeholder="请选择"
                      class="proInputWidth"
                      v-model="formData.industryId"
                    >
                      <el-option
                        v-for="item in industryId"
                        :key="item.code"
                        :label="item.name"
                        :value="item.code"
                      >
                      </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item prop="investment" label="投资类别：">
                    <el-select
                      placeholder="请选择"
                      v-model="formData.investment"
                      class="proInputWidth"
                      clearable
                      filterable
                    >
                      <el-option
                        v-for="item in investmentOptions"
                        :key="item.id"
                        :label="item.name"
                        :value="item.id"
                      ></el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="12">
                  <el-form-item prop="projectCost" label="工程造价：">
                    <el-input
                      v-model.trim="formData.projectCost"
                      placeholder="请输入金额，单位为：元"
                      class="minInputWidth"
                      clearable
                    ></el-input>
                    元
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item prop="startDate" label="开工日期：">
                    <el-date-picker
                      type="date"
                      placeholder="请选择"
                      v-model="formData.startDate"
                      class="proInputWidth"
                      clearable
                      value-format="yyyy-MM-dd"
                    ></el-date-picker>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="12">
                  <el-form-item prop="constructionCycle" label="建设周期：">
                    <el-input
                      v-model.trim="formData.constructionCycle"
                      placeholder="请输入时长，单位为：天"
                      class="minInputWidth"
                      clearable
                    ></el-input>
                    天
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item
                    prop="detailAddress"
                    label="项目部详细地址："
                    :rules="
                      isNeedAddress == 0
                        ? [{ required: false }]
                        : formRules.detailAddress
                    "
                  >
                    <div style="position: relative">
                      <el-input
                        v-model.trim="formData.detailAddress"
                        maxlength="200"
                        placeholder="请输入项目部详细地址，并在地图上确定详细位置"
                        class="proInputWidth"
                        id="suggestId"
                        @blur="hideMap"
                        ref="inputDetailAdr"
                      ></el-input>
                      <div
                        style="
                          width: 62%;
                          height: 33px;
                          background: #fff;
                          position: absolute;
                          top: 3px;
                          left: 3px;
                          z-index: 10;
                          opacity: 0;
                        "
                        @click="showMap"
                        v-if="isShowBox"
                      ></div>
                      <div
                        id="searchResultPanel"
                        style="
                          border: 1px solid #c0c0c0;
                          width: 150px;
                          height: auto;
                          display: none;
                        "
                      ></div>
                    </div>
                    <el-row class="row-padding-bottom" v-if="isShowMap">
                      <el-col :span="24" class="col-position">
                        <div
                          id="l-map"
                          style="
                            height: 300px;
                            position: absolute;
                            width: 70%;
                            z-index: 1000;
                          "
                        ></div>
                      </el-col>
                    </el-row>

                    <!-- 获取当前地址  -->
                    <div id="allmap"></div>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="12">
                  <el-form-item prop="typeId" label="工程类型：">
                    <el-select
                      clearable
                      filterable
                      placeholder="请选择"
                      class="proInputWidth"
                      v-model="formData.typeId"
                    >
                      <el-option
                        v-for="item in typeId"
                        :key="item.code"
                        :label="item.name"
                        :value="item.code"
                      >
                      </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="12" v-if="isWhUser()">
                  <el-form-item
                    prop="isStateOwnedConstruction"
                    label="是否国企施工项目："
                    :rules="
                      isNeedIsStateOwned == 0
                        ? [{ required: false }]
                        : formRules.isStateOwnedConstruction
                    "
                  >
                    <el-select
                      clearable
                      filterable
                      placeholder="请选择项目的施工总承包企业是否属于国有企业"
                      class="proInputWidth"
                      v-model="formData.isStateOwnedConstruction"
                    >
                      <el-option label="是" value="1"></el-option>
                      <el-option label="否" value="0"></el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="12" class="projectStatusBox">
                  <el-form-item prop="projectStatus" label="项目状态：">
                    <el-select
                      clearable
                      filterable
                      placeholder="请选择"
                      class="proInputWidth"
                      v-model.trim="formData.projectStatus"
                      disabled
                    >
                      <el-option
                        v-for="item in statusOptions"
                        :key="item.id"
                        :label="item.name"
                        :value="item.id"
                        :disabled="item.disabled"
                      >
                      </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>

                <el-col :span="12">
                  <el-form-item
                    prop="license"
                    label="施工许可证："
                    :rules="
                      isNeedLicense == 1
                        ? {
                            required: true,
                            message: '施工许可证不能为空',
                            trigger: 'blur ',
                          }
                        : { required: false, trigger: 'blur' }
                    "
                  >
                    <el-input
                      v-model.trim="formData.license"
                      placeholder="请输入施工许可证号,可录入多个，用“，”隔开"
                      class="proInputWidth"
                      clearable
                    ></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item
                    prop="constructLocation"
                    label="施工地址："
                    :rules="
                      isNeedConstructLocation == 0
                        ? [{ required: false }]
                        : formRules.constructLocation
                    "
                  >
                    <el-input
                      v-model.trim="formData.constructLocation"
                      placeholder="请输入施工详细地址"
                      class="proInputWidth"
                      clearable
                      @blur="formData.constructLocation = changeValue($event)"
                    ></el-input>
                    <!-- <textarea name="" id="" cols="10" rows="1" v-model.trim="formData.constructLocation" placeholder="请输入施工详细地址" class = "proInputWidth" clearable @blur="formData.constructLocation = changeValue($event)"></textarea> -->
                  </el-form-item>
                </el-col>
                <!-- </el-row>
                            <el-row> -->
                <el-col :span="12">
                  <el-form-item prop="salaryDay" label="工资发放日：">
                    <el-select
                      placeholder="请选择"
                      v-model="formData.salaryDay"
                      class="proInputWidth"
                      clearable
                      filterable
                    >
                      <el-option
                        v-for="(item, index) in 31"
                        :key="index"
                        :value="item"
                        :label="item"
                      ></el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="12" v-if="isXiangYangUser()">
                  <el-form-item
                    label="合同签订日："
                    prop="contractSignDate"
                    :rules="
                      isNeedContractSignDate == 0
                        ? [{ required: false }]
                        : formRules.contractSignDate
                    "
                  >
                    <el-date-picker
                      type="date"
                      placeholder="请选择"
                      v-model="formData.contractSignDate"
                      value-format="yyyy-MM-dd"
                      class="proInputWidth"
                      clearable
                    ></el-date-picker>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row v-if="isWhUser()">
                <el-col :span="24">
                  <el-form-item
                    label="施工许可证："
                    class="upLoadDomContainer"
                    :rules="
                      isNeedLicenseFiles == 0
                        ? [{ required: false }]
                        : formRules.upLoadFileLicense
                    "
                    prop="upLoadFileLicense"
                  >
                    <uploadAnnex
                      @getFileList="getFileListLicense"
                      :limitationFactor="limitationFactorLicense"
                      @getFile="getFileLicense"
                      :upLoadFile="upLoadFileLicense"
                    />
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row v-if="isWhUser()">
                <el-col :span="24">
                  <uploadResult
                    style="margin-left: 120px"
                    :resultList="upLoadFileLicense"
                    @callBackResult="getFileLicense"
                  />
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="24">
                  <el-form-item
                    label="开工令："
                    class="upLoadDomContainer"
                    :rules="
                      isNeedOrdFiles == 0
                        ? [{ required: false }]
                        : formRules.upLoadFileOrder
                    "
                    prop="upLoadFileOrder"
                  >
                    <uploadAnnex
                      @getFileList="getFileListOrder"
                      :limitationFactor="limitationFactorOrder"
                      @getFile="getFileOrder"
                      :upLoadFile="upLoadFileOrder"
                    />
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="24">
                  <uploadResult
                    style="margin-left: 120px"
                    :resultList="upLoadFileOrder"
                    @callBackResult="getFileOrder"
                  />
                </el-col>
              </el-row>
            </div>
            <div class="grid-content bg-purple" v-else>
              <el-row>
                <el-col :span="12">
                  <el-form-item prop="projectName" label="项目名称：">
                    <el-input
                      v-model.trim="formData.projectName"
                      placeholder="请输入项目名称"
                      class="proInputWidth"
                      clearable
                      disabled
                    ></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item
                    prop="license"
                    label="施工许可证："
                    :rules="
                      isNeedLicense == 1
                        ? {
                            required: true,
                            message: '施工许可证不能为空',
                            trigger: 'blur ',
                          }
                        : { required: false, trigger: 'blur' }
                    "
                  >
                    <el-input
                      v-model.trim="formData.license"
                      placeholder="请输入施工许可证号,可录入多个，用“，”隔开"
                      class="proInputWidth"
                      clearable
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="12">
                  <el-form-item prop="projectStatus" label="项目状态：">
                    <p>{{ projectData.statusDesc }}</p>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item prop="areaId" label="所属区域：">
                    <p>{{ projectData.areaName }}</p>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item prop="industryId" label="所属行业：">
                    <p>{{ projectData.industryName }}</p>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item prop="investment" label="投资类别：">
                    <p>{{ projectData.investmentDesc }}</p>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="12">
                  <el-form-item prop="projectCost" label="工程造价：">
                    <p>{{ projectData.total }}元</p>
                  </el-form-item>
                </el-col>
                <!-- <el-col :span="12">
                                    <el-form-item prop="startDate" label="开工日期" label-width="135px">
                                     <p>{{projectData.startDate}}</p>
                                    </el-form-item>
                                </el-col> -->
                <el-col :span="12">
                  <el-form-item prop="startDate" label="开工日期：">
                    <el-date-picker
                      type="date"
                      placeholder="请选择"
                      v-model="formData.startDate"
                      class="proInputWidth"
                      clearable
                      value-format="yyyy-MM-dd"
                    ></el-date-picker>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="12">
                  <el-form-item prop="constructionCycle" label="建设周期：">
                    <el-input
                      v-model.trim="formData.constructionCycle"
                      placeholder="请输入时长，单位为：天"
                      class="minInputWidth"
                      clearable
                    ></el-input>
                    天
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item
                    prop="detailAddress"
                    label="项目部详细地址："
                    :rules="
                      isNeedAddress == 0
                        ? [{ required: false }]
                        : formRules.detailAddress
                    "
                  >
                    <div style="position: relative">
                      <el-input
                        v-model.trim="formData.detailAddress"
                        maxlength="200"
                        placeholder="请输入项目部详细地址，并在地图上确定详细位置"
                        class="proInputWidth"
                        id="suggestId"
                        @blur="hideMap"
                        ref="inputDetailAdr"
                      ></el-input>
                      <div
                        style="
                          width: 62%;
                          height: 33px;
                          background: #fff;
                          position: absolute;
                          top: 3px;
                          left: 3px;
                          z-index: 10;
                          opacity: 0;
                        "
                        @click="showMap"
                        v-if="isShowBox"
                      ></div>
                      <div
                        id="searchResultPanel"
                        style="
                          border: 1px solid #c0c0c0;
                          width: 150px;
                          height: auto;
                          display: none;
                        "
                      ></div>
                    </div>
                    <el-row class="row-padding-bottom" v-if="isShowMap">
                      <el-col :span="24" class="col-position">
                        <div
                          id="l-map"
                          style="
                            height: 300px;
                            position: absolute;
                            width: 70%;
                            z-index: 1000;
                          "
                        ></div>
                      </el-col>
                    </el-row>

                    <!-- 获取当前地址  -->
                    <div id="allmap"></div>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="12">
                  <el-form-item prop="typeId" label="工程类型：">
                    <el-select
                      clearable
                      filterable
                      placeholder="请选择"
                      class="proInputWidth"
                      v-model="formData.typeId"
                    >
                      <el-option
                        v-for="item in typeId"
                        :key="item.code"
                        :label="item.name"
                        :value="item.code"
                      >
                      </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="12" v-if="isWhUser()">
                  <el-form-item
                    prop="isStateOwnedConstruction"
                    label="是否国企施工项目："
                    :rules="
                      isNeedIsStateOwned == 0
                        ? [{ required: false }]
                        : formRules.isStateOwnedConstruction
                    "
                  >
                    <el-select
                      clearable
                      filterable
                      placeholder="请选择项目的施工总承包企业是否属于国有企业"
                      class="proInputWidth"
                      v-model="formData.isStateOwnedConstruction"
                    >
                      <el-option label="是" value="1"></el-option>
                      <el-option label="否" value="0"></el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item
                    prop="constructLocation"
                    label="施工地址："
                    :rules="
                      isNeedConstructLocation == 0
                        ? [{ required: false }]
                        : formRules.constructLocation
                    "
                  >
                    <el-input
                      v-model.trim="formData.constructLocation"
                      placeholder="请输入施工详细地址"
                      class="proInputWidth"
                      clearable
                      @blur="formData.constructLocation = changeValue($event)"
                    ></el-input>
                  </el-form-item>
                </el-col>
                <!-- </el-row>
                            <el-row> -->
                <el-col :span="12" v-if="paramsType === 'projectHome'">
                  <el-form-item prop="salaryDay" label="工资发放日：">
                    <el-select
                      placeholder="请选择"
                      v-model="formData.salaryDay"
                      class="proInputWidth"
                      clearable
                      filterable
                    >
                      <el-option
                        v-for="(item, index) in 31"
                        :key="index"
                        :value="item"
                        :label="item"
                      ></el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col
                  :span="12"
                  v-if="isXiangYangUser() && paramsType === 'projectHome'"
                >
                  <el-form-item
                    label="合同签订日："
                    prop="contractSignDate"
                    :rules="
                      isNeedContractSignDate == 0
                        ? [{ required: false }]
                        : formRules.contractSignDate
                    "
                  >
                    <el-date-picker
                      type="date"
                      placeholder="请选择"
                      v-model="formData.contractSignDate"
                      value-format="yyyy-MM-dd"
                      class="proInputWidth"
                      clearable
                    ></el-date-picker>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row v-if="isWhUser()">
                <el-col :span="24">
                  <el-form-item
                    label="施工许可证："
                    class="upLoadDomContainer"
                    :rules="
                      isNeedLicenseFiles == 0
                        ? [{ required: false }]
                        : formRules.upLoadFileLicense
                    "
                    prop="upLoadFileLicense"
                  >
                    <uploadAnnex
                      @getFileList="getFileListLicense"
                      :limitationFactor="limitationFactorLicense"
                      @getFile="getFileLicense"
                      :upLoadFile="upLoadFileLicense"
                    />
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="24">
                  <uploadResult
                    style="margin-left: 120px"
                    :resultList="upLoadFileLicense"
                    @callBackResult="getFileLicense"
                  />
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="24">
                  <el-form-item
                    label="开工令："
                    class="upLoadDomContainer"
                    :rules="
                      isNeedOrdFiles == 0
                        ? [{ required: false }]
                        : formRules.upLoadFileOrder
                    "
                    prop="upLoadFileOrder"
                  >
                    <uploadAnnex
                      @getFileList="getFileListOrder"
                      :limitationFactor="limitationFactorOrder"
                      @getFile="getFileOrder"
                      :upLoadFile="upLoadFileOrder"
                    />
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="24">
                  <uploadResult
                    style="margin-left: 120px"
                    :resultList="upLoadFileOrder"
                    @callBackResult="getFileOrder"
                  />
                </el-col>
              </el-row>
            </div>
          </el-col>
        </el-row>
        <el-divider></el-divider>
        <el-row>
          <el-col>
            <div class="secondaryTitle secondaryTitleTheme mrB30 mrT24">
              建设方信息
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <div class="grid-content bg-purple">
              <el-row>
                <el-col :span="12">
                  <el-form-item prop="pcName" label="单位名称：">
                    <!-- v-if="userType == 'PROJECT_ADMINISTRATOR' || userType == 'LABOR_ADMINISTRATOR'" -->
                    <el-input
                      v-model.trim="formData.pcName"
                      @change="
                        validUsccAndCompany(formData.pcName, formData.pcUscc)
                      "
                      placeholder="请输入单位名称"
                      class="proInputWidth"
                      clearable
                    ></el-input>
                    <!-- <span>{{formData.pcName}}</span> -->
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item prop="pcUscc" label="统一社会信用代码：">
                    <el-input
                      v-model.trim="formData.pcUscc"
                      @change="
                        validUsccAndCompany(formData.pcName, formData.pcUscc)
                      "
                      placeholder="请输入统一社会信用代码"
                      class="proInputWidth"
                      clearable
                    ></el-input>
                    <!-- <span>{{formData.pcUscc}}</span> -->
                  </el-form-item>
                </el-col>
              </el-row>

              <el-row>
                <el-col :span="12">
                  <el-form-item
                    label=""
                    prop="pcLeader"
                    :rules="
                      isNeedPcLeader == 0
                        ? [{ required: false }]
                        : formRules.pcLeader
                    "
                  >
                    <span slot="label"
                      >项目负责人
                      <el-tooltip
                        content="Top center"
                        placement="top"
                        effect="dark"
                      >
                        <div slot="content">业主单位负责管理该项目的人员</div>
                        <i class="icon iconfont iconhuabanfuben"></i>
                      </el-tooltip>
                      ：</span
                    >
                    <el-input
                      v-model.trim="formData.pcLeader"
                      placeholder="请输入项目全权负责人姓名"
                      class="proInputWidth"
                      clearable
                    ></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item
                    label="负责人手机号码："
                    prop="pcLeaderTel"
                    :rules="
                      isNeedPcLeaderTel == 0
                        ? [{ required: false }]
                        : formRules.pcLeaderTel
                    "
                  >
                    <el-input
                      v-model.trim="formData.pcLeaderTel"
                      placeholder="请输入项目全权负责人手机号码"
                      class="proInputWidth"
                      clearable
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
            </div>
          </el-col>
        </el-row>
        <el-divider></el-divider>
        <el-row>
          <el-col>
            <div class="secondaryTitle secondaryTitleTheme mrB30 mrT24">
              施工方信息
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <div class="grid-content bg-purple">
              <el-row>
                <el-col :span="12">
                  <el-form-item prop="pbName" label="单位名称：">
                    <el-input
                      v-model.trim="formData.pbName"
                      @change="
                        validUsccAndCompany(formData.pbName, formData.pbUscc)
                      "
                      placeholder="请输入请输入单位名称"
                      class="proInputWidth"
                      clearable
                    ></el-input>
                    <!-- <span>{{formData.pbName}}</span> -->
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item prop="pbUscc" label="统一社会信用代码：">
                    <el-input
                      v-model.trim="formData.pbUscc"
                      @change="
                        validUsccAndCompany(formData.pbName, formData.pbUscc)
                      "
                      placeholder="请输入统一社会信用代码"
                      class="proInputWidth"
                      clearable
                    ></el-input>
                    <!-- <span>{{formData.pbUscc}}</span> -->
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="12">
                  <el-form-item
                    prop="leader"
                    label="项目负责人："
                    :rules="
                      isNeedLeader == 0
                        ? [{ required: false }]
                        : formRules.leader
                    "
                  >
                    <span slot="label">
                      项目负责人
                      <el-tooltip
                        content="Top center"
                        placement="top"
                        effect="dark"
                      >
                        <div slot="content">
                          施工单位负责管理项目的人员，建档后项目账号将发送至负责人手机号
                        </div>
                        <i class="icon iconfont iconhuabanfuben"></i>
                      </el-tooltip>
                      ：
                    </span>
                    <el-input
                      v-model.trim="formData.leader"
                      placeholder="请输入项目全权负责人姓名"
                      class="proInputWidth"
                      clearable
                    ></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item
                    prop="leaderTel"
                    label="负责人手机号码："
                    :rules="
                      isNeedLeaderTel == 0
                        ? [{ required: false }]
                        : formRules.leaderTel
                    "
                  >
                    <el-input
                      v-model.trim="formData.leaderTel"
                      placeholder="请输入项目全权负责人手机号码"
                      class="proInputWidth"
                      clearable
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
            </div>
          </el-col>
        </el-row>
        <el-divider></el-divider>
        <el-row>
          <el-col>
            <div class="secondaryTitle secondaryTitleTheme mrB30 mrT24">
              项目经理信息
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <div class="grid-content bg-purple">
              <el-row>
                <el-col :span="12">
                  <el-form-item
                    prop="managerName"
                    label="项目经理姓名："
                    :rules="
                      isNeedManagerName == 1
                        ? {
                            required: true,
                            message: '请输入项目经理姓名',
                            trigger: 'change',
                          }
                        : { required: false, trigger: 'blur' }
                    "
                  >
                    <el-input
                      v-model.trim="formData.managerName"
                      placeholder="请输入项目经理姓名"
                      class="proInputWidth"
                      clearable
                    ></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item
                    label="项目经理身份证号："
                    prop="managerIdcard"
                    :rules="
                      isNeedManagerIdcard == 0
                        ? [
                            {
                              required: false,
                              pattern:
                                /^(([1-9][0-9]{5}(19|20)[0-9]{2}((0[1-9])|(1[0-2]))([0-2][1-9]|10|20|30|31)[0-9]{3}([0-9]|X|x))|([1-9][0-9]{5}[0-9]{2}((0[1-9])|(1[0-2]))([0-2][1-9]|10|20|30|31)[0-9]{3}))$/,
                              message: '请输入正确的身份证号',
                              trigger: 'blur',
                            },
                          ]
                        : formRules.managerIdcard
                    "
                  >
                    <el-input
                      v-model.trim="formData.managerIdcard"
                      placeholder="请输入项目经理身份证号"
                      class="proInputWidth"
                      clearable
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="12">
                  <el-form-item
                    prop="managerTel"
                    label="项目经理手机号码："
                    :rules="
                      isNeedManagerTel == 0
                        ? [
                            {
                              required: false,
                              pattern: /^1[3456789]\d{9}$/,
                              message: '请输入正确的手机号码',
                              trigger: 'blur',
                            },
                          ]
                        : formRules.managerTel
                    "
                  >
                    <el-input
                      v-model.trim="formData.managerTel"
                      placeholder="请输入项目经理手机号"
                      class="proInputWidth"
                      clearable
                    ></el-input>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="24">
                  <el-form-item
                    label="项目经理资格证书："
                    prop="managerUpLoadFile"
                    :rules="
                      isNeedMgFiles == 0
                        ? [{ required: false }]
                        : formRules.managerUpLoadFile
                    "
                  >
                    <uploadAnnex
                      @getFileList="getFileListManager"
                      :limitationFactor="limitationFactorManager"
                      @getFile="getFileManager"
                      :upLoadFile="managerUpLoadFile"
                    />
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row v-if="managerUpLoadFile.length > 0">
                <el-col :span="24" v-model="formData.managerImgUrl">
                  <!-- <elementImage :upLoadFile="managerUpLoadFile"   :srcList="managerSrcList" :oldSrcList="managerOldSrcList" @changeSrcList="changeSrcList"></elementImage> -->
                  <uploadResult
                    style="margin-left: 120px"
                    :resultList="managerUpLoadFile"
                    @callBackResult="getFileManager"
                  />
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="24">
                  <el-form-item
                    label="项目经理企业任命文件："
                    prop="manUploadFiles"
                    class="manUploads"
                    :rules="
                      isAppointJson == 0
                        ? [{ required: false }]
                        : formRules.manUploadFiles
                    "
                  >
                    <uploadAnnex
                      @getFileList="getFileListManFiles"
                      :limitationFactor="limitationFactorManFiles"
                      @getFile="getFileManFiles"
                      :upLoadFile="manUploadFiles"
                    />
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="24">
                  <uploadResult
                    style="margin-left: 120px"
                    :resultList="manUploadFiles"
                    @callBackResult="getFileManFiles"
                  />
                </el-col>
              </el-row>
            </div>
          </el-col>
        </el-row>
        <el-divider></el-divider>
        <el-row>
          <el-col>
            <div class="secondaryTitle secondaryTitleTheme mrB30 mrT24">
              合同信息
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <div class="grid-content bg-purple">
              <el-row>
                <el-col :span="24">
                  <el-form-item
                    label="合同附件："
                    :rules="
                      isNeedUpLoadFile == 0
                        ? [{ required: false }]
                        : formRules.upLoadFile
                    "
                    prop="upLoadFile"
                  >
                    <uploadAnnex
                      @getFileList="getFileList"
                      :limitationFactor="limitationFactor"
                      @getFile="getFile"
                      :upLoadFile="upLoadFile"
                    />
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="24">
                  <!-- <elementImage :upLoadFile="upLoadFile"   :srcList="srcList" :oldSrcList="oldSrcList" @changeSrcList="changeList"></elementImage> -->
                  <uploadResult
                    style="margin-left: 120px"
                    :resultList="upLoadFile"
                    @callBackResult="getFile"
                  />
                </el-col>
              </el-row>
            </div>
          </el-col>
        </el-row>
        <el-row
          style="text-align: center; margin-top: 20px; margin-bottom: 40px"
        >
          <el-col :span="24">
            <!-- <el-form-item> -->
            <el-button
              class="commonBut saveBtn"
              type="primary"
              v-sdc
              @click="saveToDetail"
              :loading="isSaveLoading"
              >保存</el-button
            >
            <!-- </el-form-item> -->
          </el-col>
        </el-row>
      </el-form>
    </div>
  </div>
</template>

<script>
import { mapActions, mapState } from 'vuex'
export default {
  name: 'projectInfoUpd',
  components: {},
  props: ['docProjectId', 'idF', 'type'],
  data() {
    // 验证工程造价
    var checkMoney = (rule, value, callback) => {
      if (!value) {
        return callback(new Error('工程造价不能为空'))
      } else {
        var reProjectCost =
          /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/
        if (!reProjectCost.test(value) || value == 0.0 || value == 0.0) {
          callback(new Error('工程造价格式不正确,必须大于0,最多带有2位小数'))
        } else {
          if (value >= 100000000000) {
            callback(new Error('工程造价需小于1000亿'))
          } else {
            if (!this.isSubmit && this.loginType == 'JC') {
              if (this.projectData.total != value) {
                callback(
                  new Error(
                    '修改后将影响专户应拨付金额、保证金应缴金额以及相关预警、信用评分，请知悉'
                  )
                )
              } else {
                callback()
              }
            } else {
              callback()
            }
          }
        }
      }
    }
    // 验证建设周期
    var validateConCycle = (rule, value, callback) => {
      if (value === '') {
        callback(new Error('建设周期不能为空'))
      } else {
        var ConCycle = /^\+?[1-9]\d*$/
        if (!ConCycle.test(value)) {
          callback(new Error('建设周期必须是正整数'))
        } else {
          if (value >= 36500) {
            callback(new Error('建设周期不能大于36500天'))
          } else {
            callback()
          }
        }
      }
    }
    var checkArea = (rule, value, callback) => {
      if (!this.areaId || this.areaId.length < 1) {
        return callback(new Error('所属区域不能为空'))
      } else {
        if (!this.isSubmit && this.loginType == 'JC') {
          if (
            this.projectData.areaList[this.projectData.areaList.length - 1] !=
            value
          ) {
            return callback(new Error('修改后原有区域将无法查看该项目，请知悉'))
          } else {
            callback()
          }
        } else {
          callback()
        }
      }
    }
    var checkIndustryId = (rule, value, callback) => {
      value = value.replace(/\s+/g, '')
      if (value === '') {
        return callback(new Error('所属行业不能为空'))
      } else {
        if (!this.isSubmit && this.loginType == 'JC') {
          if (this.projectData.industryId != value) {
            return callback(
              new Error('修改后原有行业主管将无法查看该项目，请知悉')
            )
          } else {
            callback()
          }
        } else {
          callback()
        }
      }
    }
    var validAddress = (rule, value, callback) => {
      var that = this
      var address = that.formData.detailAddress.replace(/\s/g, '')
      setTimeout(function () {
        if (!that.lat || !address) {
          return callback(new Error('请输入有效地址'))
        } else {
          callback()
        }
      }, 500)
    }
    //验证企业名称
    var validateName = (rule, value, callback) => {
      value = value.replace(/\s+/g, '')
      if (value === '') {
        callback(new Error('企业名称不能为空'))
      } else {
        if (value.length > 100) {
          callback(new Error('企业名称不能超过100个字符'))
        } else {
          if (this.formData.jsUscc !== '') {
            this.$refs.formData.validateField('jsUscc')
          }

          callback()
        }
      }
    }
    //验证uscc
    var validateUscc = (rule, value, callback) => {
      value = value.replace(/\s+/g, '')
      if (value === '') {
        callback(new Error('统一社会信用代码不能为空'))
      } else {
        var regUscc = /^[0-9A-Z]{2}[0-9]{6}[0-9A-Z]{10}$/
        if (!regUscc.test(value)) {
          callback(new Error('统一社会信用代码格式不正确'))
        } else {
          var companyName = this.formData.unitName
          if (this.jsFlag == '') {
            this.validUscc(companyName, value, callback)
          } else {
            if (
              (this.jsName != companyName ||
                this.jsUscc != value ||
                this.jsFlag == '2') &&
              this.saveFlag == '1'
            ) {
              this.validUscc(companyName, value, callback)
            } else {
              callback()
            }
          }
        }
      }
    }
    var validateManagerUpLoadFile = (rele, value, callback) => {
      if (this.managerUpLoadFile.length < 1) {
        return callback(new Error('必须上传项目经理资格证书'))
      } else {
        callback()
      }
    }
    var checkProjectName = (rule, value, callback) => {
      value = value.replace(/\s+/g, '')
      if (value === '') {
        callback(new Error('项目名称不能为空'))
      } else {
        this.validProName(rule, value, callback)
      }
    }
    var checkStartDate = (rule, value, callback) => {
      value = value.replace(/\s+/g, '')
      if (value === '') {
        callback(new Error('开工日期不能为空'))
      } else {
        if (!this.isSubmit && this.loginType == 'JC') {
          if (this.projectData.startDate != value) {
            return callback(
              new Error(
                '修改后将影响与开工日期有关的信用指标评分、拨付计划以及预警，请知悉'
              )
            )
          } else {
            callback()
          }
        } else {
          callback()
        }
      }
    }
    var checkSalaryDay = (rule, value, callback) => {
      if (value === '' || value === undefined || value === null) {
        callback(new Error('工资发放日不能为空'))
      } else {
        if (!this.isSubmit && this.loginType == 'JC') {
          if (this.projectData.salaryDay != value) {
            return callback(new Error('修改后将影响工资代发相关的预警，请知悉'))
          } else {
            callback()
          }
        } else {
          callback()
        }
      }
    }
    var checkProjectStatus = (rule, value, callback) => {
      if (value === '') {
        callback(new Error('项目状态不能为空'))
      } else {
        if (this.loginType == 'JC') {
          if (!this.isSubmit) {
            if (this.projectData.status != value) {
              if (value == 'STARTED') {
                return callback(
                  new Error(
                    '项目开工后将按照政策产生预警，并进行信用评分，请知悉'
                  )
                )
              }
              if (value == 'STOPPED' || value == 'COMPLETED') {
                return callback(new Error('项目停工/竣工后将停止预警，请知悉'))
              }
              if (value == 'NOT_STARTED') {
                //恩施独有的逻辑
                if (this.isEsUser()) {
                  // if(value == 'NOT_STARTED'){
                  if (this.projectData.status == 'STARTED') {
                    return callback(
                      new Error('已开工项目不允许设置为未开工状态。')
                    )
                  } else if (
                    ['STOPPED', 'COMPLETED'].includes(this.projectData.status)
                  ) {
                    return callback(
                      new Error('已停工、已竣工状态，不能修改为未开工。')
                    )
                  }
                  // }else{
                  //     callback();
                  // }
                } else {
                  return callback(new Error('项目未开工，将停止预警，请知悉'))
                }
              }
            } else {
              callback()
            }
          } else {
            //恩施独有的逻辑
            if (
              this.projectData.status != value &&
              value == 'NOT_STARTED' &&
              this.isEsUser()
            ) {
              if (this.projectData.status == 'STARTED') {
                return callback(new Error('已开工项目不允许设置为未开工状态。'))
              } else if (
                ['STOPPED', 'COMPLETED'].includes(this.projectData.status)
              ) {
                return callback(
                  new Error('已停工、已竣工状态，不能修改为未开工。')
                )
              }
            } else {
              callback()
            }
          }
        } else {
          callback()
        }
      }
    }
    var validateConAddress = (rule, value, callback) => {
      value = value.toString().replace(/\s+/g, '')
      if (value === '') {
        callback(new Error('请输入施工地址'))
      } else {
        if (value.length > 50) {
          callback(new Error('施工地址最多可输入50字'))
        } else {
          callback()
        }
      }
    }
    var checkUpLoadFileOrder = (rule, value, callback) => {
      if (this.upLoadFileOrder.length == 0) {
        return callback(new Error('请上传开工令附件'))
      } else {
        callback()
      }
    }
    // 武汉施工许可证
    var checkUpLoadFileLicense = (rule, value, callback) => {
      if (this.upLoadFileLicense.length == 0) {
        return callback(new Error('请上传施工许可证'))
      } else {
        callback()
      }
    }
    // 合同附件
    var checkUpLoadFile = (rule, value, callback) => {
      if (this.upLoadFile.length == 0) {
        return callback(new Error('请上传合同附件'))
      } else {
        callback()
      }
    }
    var validateManUploadFiles = (rule, value, callback) => {
      if (this.manUploadFiles.length == 0) {
        return callback(new Error('请上传项目经理企业任命文件'))
      } else {
        callback()
      }
    }
    return {
      hasSameName: false,
      formData: {
        projectStatus: '',
        industryId: '',
        investment: '',
        projectCost: '',
        startDate: '',
        constructionCycle: '',
        typeId: '',
        detailAddress: '',
        areaId: '',
        leader: '',
        leaderTel: '',
        pcName: '',
        pcUscc: '',
        pbName: '',
        pbUscc: '',
        pcLeader: '',
        pcLeaderTel: '',
        managerIdcard: '',
        managerName: '',
        managerTel: '',
        projectName: '',
        license: '', // 施工许可证
        salaryDay: '', //项目端首页跳转添加工资发放日
        constructLocation: '', //施工地址
        isStateOwnedConstruction: '',
        contractSignDate: '',
      },
      formRules: {
        isStateOwnedConstruction: [
          {
            required: true,
            message: '请选择项目的施工总承包企业是否属于国有企业',
            trigger: 'change',
          },
        ],
        projectName: [
          {
            required: true,
            validator: checkProjectName,
            // message: "项目状态不能为空",
            trigger: 'blur',
          },
        ],
        pcLeader: [
          { required: true, message: '请输入项目负责人', trigger: 'blur' },
        ],
        pcLeaderTel: [
          { required: true, message: '请输入负责人手机号码', trigger: 'blur' },
        ],
        projectStatus: [
          {
            required: true,
            // message: "项目状态不能为空",
            validator: checkProjectStatus,
            trigger: 'change',
          },
        ],
        areaId: [
          {
            required: true,
            validator: checkArea,
            // message: "所属区域不能为空",
            trigger: 'change',
          },
        ],
        industryId: [
          {
            required: true,
            validator: checkIndustryId,
            // message: "所属行业不能为空",
            trigger: 'change',
          },
        ],
        investment: [
          {
            required: true,
            message: '投资类别不能为空',
            trigger: 'change',
          },
        ],
        projectCost: [
          {
            required: true,
            validator: checkMoney,
            trigger: 'blur',
          },
        ],
        startDate: [
          {
            required: true,
            // message: "开工日期不能为空",
            validator: checkStartDate,
            trigger: 'change',
          },
        ],
        constructionCycle: [
          {
            required: true,
            validator: validateConCycle,
            trigger: 'blur',
          },
        ],
        typeId: [
          {
            required: true,
            message: '工程类型不能为空',
            trigger: 'change',
          },
        ],
        detailAddress: [
          {
            required: true,
            validator: validAddress,
            trigger: 'change',
          },
        ],
        leader: [
          {
            required: true,
            message: '项目全权负责人姓名不能为空',
            trigger: 'blur',
          },
        ],
        leaderTel: [
          {
            required: true,
            pattern: /^1[3456789]\d{9}$/,
            message: '请输入正确的手机号码',
            trigger: 'blur',
          },
        ],
        pcName: [
          { required: true, validator: validateName, trigger: 'change' },
        ],
        pcUscc: [
          { required: true, validator: validateUscc, trigger: 'change' },
        ],
        pbName: [
          { required: true, validator: validateName, trigger: 'change' },
        ],
        pbUscc: [
          { required: true, validator: validateUscc, trigger: 'change' },
        ],
        managerName: [
          {
            required: true,
            message: '项目全权负责人姓名不能为空',
            trigger: 'blur',
          },
        ],
        managerIdcard: [
          {
            required: true,
            pattern:
              /^(([1-9][0-9]{5}(19|20)[0-9]{2}((0[1-9])|(1[0-2]))([0-2][1-9]|10|20|30|31)[0-9]{3}([0-9]|X|x))|([1-9][0-9]{5}[0-9]{2}((0[1-9])|(1[0-2]))([0-2][1-9]|10|20|30|31)[0-9]{3}))$/,
            message: '请输入正确的身份证号',
            trigger: 'blur',
          },
        ],
        managerTel: [
          {
            required: true,
            pattern: /^1[3456789]\d{9}$/,
            message: '请输入正确的手机号码',
            trigger: 'blur',
          },
        ],
        salaryDay: [
          {
            required: true,
            validator: checkSalaryDay,
            // message: "工资发放日不能为空",
            trigger: 'change',
          },
        ],
        managerUpLoadFile: [
          {
            required: true,
            validator: validateManagerUpLoadFile,
            trigger: 'change',
          },
        ],
        constructLocation: [
          { required: true, validator: validateConAddress, trigger: 'blur' },
        ],
        upLoadFileOrder: [
          {
            required: true,
            validator: checkUpLoadFileOrder,
            trigger: 'blur',
          },
        ],
        contractSignDate: [
          { required: true, message: '请选择合同签订日', trigger: 'change' },
        ],
        upLoadFileLicense: [
          {
            required: true,
            validator: checkUpLoadFileLicense,
            trigger: 'blur',
          },
        ],
        upLoadFile: [
          {
            required: true,
            validator: checkUpLoadFile,
            trigger: 'blur',
          },
        ],
        manUploadFiles: [
          {
            required: true,
            validator: validateManUploadFiles,
            trigger: 'change',
          },
        ],
      },
      isShowMap: false, //是否显示地图
      lon: '',
      lat: '',
      LocationPoint: '',
      isShowBox: true,
      selectData: '',
      typeId: [], //工程类型
      investment: [], //投资类别
      industryId: [], //所属行业
      startStatus: 'startStatus', //状态样式
      statusDesc: '',
      status: '',
      areaId: [],
      projectData: '',
      projectId: '',
      isSaveLoading: false, // 保存loading
      isFB: false, // 是否分包页面
      upLoadFile: [], //附件
      srcList: [],
      oldSrcList: [],
      managerUpLoadFile: [], //项目经理资质附件
      managerSrcList: [],
      managerOldSrcList: [],
      upLoadFileLicense: [], //施工许可证附件
      srcListLicense: [],
      oldSrcListLicense: [],
      upLoadFileOrder: [], //开工令附件
      srcListOrder: [],
      oldSrcListOrder: [],
      // 项目经理资格证书
      limitationFactorManager: {
        uploadAnnexUrl: 'api-f/files/upload', //自定义上传文件接口地址
        upLoadFileLength: 10, //自定义上传文件最大数量设置
        fileSize: 5, //自定义上传文件最大设置
        formatType: 'typeFour', //自定义上传格式校验类型
        fileId: 'managerFiles', //自定义id解决一个页面包含多个上传附件
        uploadFormId: 'managerFilesForm', //自定义id解决一个页面包含多个上传附件
        messagetip:
          '要求格式为png，jpg，jpeg，doc，docx，xls，xlsx，pdf格式，附件大小不超过5M', //自定义报错提示语
        methodTip:
          '请上传项目项目经理资质证书，附件格式支持png，jpg，jpeg，doc，docx，xls，xlsx，pdf，最多上传10个附件', //自定义上传文件提示
        uploadBtnType: 'typeOne', //自定义上传按钮类型
      },
      // 合同信息
      limitationFactor: {
        uploadAnnexUrl: 'api-f/files/upload', //自定义上传文件接口地址
        upLoadFileLength: 10, //自定义上传附件的个数设置
        fileSize: 5, //自定义上传文件最大设置
        formatType: 'typeFour', //自定义上传格式校验类型
        fileId: 'salaryExcel', //自定义id解决一个页面包含多个上传附件
        uploadFormId: 'salaryExcelForm', //自定义id解决一个页面包含多个上传附件
        messagetip:
          '要求格式为png，jpg，jpeg，doc，docx，xls，xlsx，pdf格式，附件大小不超过5M', //自定义报错提示语
        methodTip:
          '请上传项目合同（必须包含项目名称、甲乙双方、工程造价、工期等必要内容），附件格式支持png，jpg，jpeg，doc，docx，xls，xlsx，pdf，最多上传10个附件', //自定义上传文件提示
        uploadBtnType: 'typeOne', //自定义上传按钮类型
      },
      // 施工许可证
      limitationFactorLicense: {
        uploadAnnexUrl: 'api-f/files/upload', //自定义上传文件接口地址
        upLoadFileLength: 10, //自定义上传附件的个数设置
        fileSize: 5, //自定义上传文件最大设置
        formatType: 'typeFour', //自定义上传格式校验类型
        fileId: 'license', //自定义id解决一个页面包含多个上传附件
        uploadFormId: 'licenseForm', //自定义id解决一个页面包含多个上传附件
        messagetip:
          '要求格式为png，jpg，jpeg，doc，docx，xls，xlsx，pdf格式，附件大小不超过5M', //自定义报错提示语
        methodTip:
          '请上传施工许可证，附件格式支持png，jpg，jpeg，doc，docx，xls，xlsx，pdf，最多上传10个附件', //自定义上传文件提示
        uploadBtnType: 'typeOne', //自定义上传按钮类型
      },
      // 开工令
      limitationFactorOrder: {
        uploadAnnexUrl: 'api-f/files/upload', //自定义上传文件接口地址
        upLoadFileLength: 10, //自定义上传附件的个数设置
        fileSize: 5, //自定义上传文件最大设置
        formatType: 'typeFour', //自定义上传格式校验类型
        fileId: 'startOrder', //自定义id解决一个页面包含多个上传附件
        uploadFormId: 'startOrderForm', //自定义id解决一个页面包含多个上传附件
        messagetip:
          '要求格式为png，jpg，jpeg，doc，docx，xls，xlsx，pdf格式，附件大小不超过5M', //自定义报错提示语
        methodTip:
          '请上传开工令，附件格式支持png，jpg，jpeg，doc，docx，xls，xlsx，pdf，最多上传10个附件', //自定义上传文件提示
        uploadBtnType: 'typeOne', //自定义上传按钮类型
      },
      // 任命书
      limitationFactorManFiles: {
        uploadAnnexUrl: 'api-f/files/upload', //自定义上传文件接口地址
        upLoadFileLength: 10, //自定义上传附件的个数设置
        fileSize: 5, //自定义上传文件最大设置
        formatType: 'typeFour', //自定义上传格式校验类型
        fileId: 'manUploadFiles', //自定义id解决一个页面包含多个上传附件
        uploadFormId: 'manFilesForm', //自定义id解决一个页面包含多个上传附件
        messagetip:
          '要求格式为png，jpg，jpeg，doc，docx，xls，xlsx，pdf格式，附件大小不超过5M', //自定义报错提示语
        methodTip:
          '请上传项目经理任命书，附件格式支持png，jpg，jpeg，doc，docx，xls，xlsx，pdf，最多上传10个附件', //自定义上传文件提示
        uploadBtnType: 'typeOne', //自定义上传按钮类型
      },
      projectName: '',
      statusOptions: [],
      paramsType: '', //是否是从项目端首页跳转标识
      pcIsValid: '', //建设方新华信用接口是否验证通过，通过则为0，没有为1
      pbIsValid: '', //施工方新华信用接口是否验证通过，通过则为0，没有为1
      oldPbName: '', //旧的施工方名称
      oldPbUscc: '', //旧的施工方uscc
      userType: '', //用户类型
      loginType: '',
      isSubmit: false, //是否是保存
      isdisabled: false,
      list: [],
      isNeedLicense: '', //施工许可证
      isNeedOrdFiles: '', //开工令附件
      isNeedUpLoadFile: '', //合同附件
      isNeedManagerName: '', //项目经理姓名
      isNeedManagerIdcard: '', //项目经理身份证号
      isNeedManagerTel: '', //项目经理手机号码
      isNeedMgFiles: '', //项目经理资格证书
      isNeedIsStateOwned: '', //是否国企施工项目
      isNeedContractSignDate: '', //合同签订日
      isNeedLicenseFiles: '', //武汉施工许可证
      manFilesOldSrcList: [], //任命书
      isAppointJson: '', //项目经理任命文件
      manFilesSrcList: [],
      manUploadFiles: [],
      isNeedAddress: '', //详细地址
      isNeedConstructLocation: '', //施工地址
      isNeedPcLeader: '', //建设方负责人
      isNeedPcLeaderTel: '', //建设方负责人手机号
      isNeedLeader: '',
      isNeedLeaderTel: '',
    }
  },
  async created() {
    await this.getIsNeed() //是否必填
    this.projectId = this.$route.query.projectId
    this.isFB = this.$route.query.isFB
    this.paramsType = this.$route.query.paramsType
      ? this.$route.query.paramsType
      : ''
    this.getSelecData('INDUSTRY') //所属行业
    this.getSelecData('PROJECT_INVESTMENT') //投资类别
    this.getSelecData('PROJECT_TYPE') //工程类型
    //修改开工状态新接口
    this.getStatus()
    this.getAreas({ areaId: this.$store.state.areaInfoArr.areaId })
    //初始化信息
    this.getData()
    this.userType = this.$store.state.userType
    this.loginType = window.localStorage.getItem('loginType')
    // if(this.loginType == 'JC'){
    //    delete this.formRules.managerName
    //    delete this.formRules.managerIdcard
    //    delete this.formRules.managerTel
    //    delete this.formRules.managerUpLoadFile //监察端不用校验项目经理证书
    // }else{
    // delete this.formRules.projectStatus
    // delete this.formRules.areaId
    // delete this.formRules.industryId
    // delete this.formRules.investment
    // delete this.formRules.projectCost
    // delete this.formRules.startDate
    // }
  },
  computed: {
    ...mapState(['areasOptions', 'investmentOptions']),
  },
  mounted() {
    this.$nextTick(function () {
      this.getLocation()
    })
  },
  methods: {
    ...mapActions(['getAreas']),
    getStatus() {
      this.axios({
        method: 'post',
        url: '/api-p/projectstats/expand/monitorstatus',
      })
        .then((response) => {
          //监察端 允许选择所有状态
          let arr = response.data.result
          // if(this.isXiangYangUser() || this.isWhUser() || this.isCzUser()){
          //     if(this.userType =='DIRECTOR' || this.userType == 'AREAMANAGE' ||this.userType == 'MONITOR' || this.userType == 'CHIEF') {
          //        this.isdisabled = true;
          //     }else {
          //        this.isdisabled = false;
          //     }
          // }else {
          if (this.loginType == 'JC') {
            arr.forEach((item) => {
              item.disabled = false
            })
          }
          // }

          this.statusOptions = arr
        })
        .catch((response) => {})
    },
    goBackOne() {
      if (this.isFB) {
        this.$router.push({
          path: '/home/indexHome/subcontractHome',
          name: 'subcontractHome',
          query: {
            projectId: this.projectId,
          },
        })
        this.$store.commit('CHANGE_SLIDER_NAME', {
          oldUrl: '/home/indexHome/subcontractHome',
          newUrl: this.$router.currentRoute.fullPath,
        })
      } else {
        //项目端首页跳转
        if (this.paramsType === 'projectHome') {
          this.$router.push({
            path: '/home/indexHome/projectHome',
            name: 'projectHome',
            query: {
              projectId: this.projectId,
            },
          })
          this.$store.commit('CHANGE_SLIDER_NAME', {
            oldUrl: '/home/indexHome/projectHome',
            newUrl: this.$router.currentRoute.fullPath,
          })
        } else {
          //监察看板详情修改跳转
          this.$router.push({
            path: '/home/monitorProjectManagement/projectDetail',
            name: 'projectDetail',
            query: {
              projectId: this.projectId,
            },
          })
          this.$store.commit('CHANGE_SLIDER_NAME', {
            oldUrl: '/home/project/projectList',
            newUrl: this.$router.currentRoute.fullPath,
          })
        }
      }
    },
    saveToDetail() {
      // if(!this.hasSameName){

      // }
      // if(this.hasSameName){
      //     this.$message({
      //         type: 'warning',
      //         message:'您修改的项目名称已存在，请核实后重新输入；'
      //     })
      //     return false
      // }
      this.isSubmit = true
      this.$refs.formData.validate((valid) => {
        if (valid) {
          // 保存更新
          // this.isSaveLoading = true;
          // this.submitFormUptate();
          this.isSubmit = false
          if (
            this.userType == 'PROJECT_ADMINISTRATOR' ||
            this.userType == 'LABOR_ADMINISTRATOR'
          ) {
            //验证建设方施工方调取新华信用接口    pc 建设方   pb 施工方
            this.validateUsccXH(
              this.formData.pcName.replace(/\s+/g, ''),
              this.formData.pcUscc.replace(/\s+/g, ''),
              'pc'
            )
            this.validateUsccXH(
              this.formData.pbName.replace(/\s+/g, ''),
              this.formData.pbUscc.replace(/\s+/g, ''),
              'pb'
            )
            //该项目属于该企业一专户多项目的项目之一则弹框提示(修改施工方);
            // setTimeout(()=> {
            //     this.judgeCompanyAccount();
            // },500)
            if (
              this.oldPbUscc != this.formData.pbUscc.replace(/\s+/g, '') ||
              this.oldPbName != this.formData.pbName.replace(/\s+/g, '')
            ) {
              setTimeout(() => {
                this.judgeCompanyAccount()
              }, 500)
            } else {
              this.isSaveLoading = true
              setTimeout(() => {
                this.submitFormUptate()
              }, 500)
            }
          } else {
            this.isSaveLoading = true
            this.submitFormUptate()
          }
        } else {
          this.isSubmit = false
          return false
        }
      })
    },
    judgeCompanyAccount() {
      this.axios({
        method: 'post',
        url: 'api-acc/companyaccount/expand/isMoreAccount',
        data: {
          uscc: this.oldPbUscc, //老的施工方统一社会信用代码
        },
      })
        .then((response) => {
          //true表示是一专户多项目
          if (response.data.hasError) {
            this.showTip(
              response.data.result.companyName,
              response.data.result.uscc
            )
          } else {
            this.isSaveLoading = true
            this.submitFormUptate()
          }
        })
        .catch((error) => {})
    },
    showTip(companyName, uscc) {
      var html =
        '<div>该项目已使用了' +
        companyName +
        '（' +
        uscc +
        '）设立的统一专户，' +
        '修改后将解除该项目对于统一专户的使用，请确认是否修改施工方信息' +
        '</div>'
      this.$confirm(html, '提示', {
        dangerouslyUseHTMLString: true,
        type: 'warning',
        confirmButtonText: '确定',
        cancelButtonText: '取消',
      })
        .then((action) => {
          this.isSaveLoading = true
          this.submitFormUptate()
        })
        .catch(() => {})
    },
    validateUsccXH(name, uscc, type) {
      this.axios({
        method: 'post',
        url: '/api-c/company/expand/validuscc', //api-c/companyaudit/base/validcompanyuscc
        data: {
          companyName: name,
          uscc: uscc,
        },
      })
        .then((res) => {
          //通过则为0，没有为1
          if (!res.data.hasError) {
            if (type == 'pc') {
              this.pcIsValid = '0'
            } else {
              this.pbIsValid = '0'
            }
          } else {
            if (type == 'pc') {
              this.pcIsValid = '1'
            } else {
              this.pbIsValid = '1'
            }
          }
        })
        .catch(() => {})
    },
    submitFormUptate() {
      var data = {
        id: this.projectId,
        lon: this.lon,
        lat: this.lat,
        projectName: this.formData.projectName,
        industryId: this.formData.industryId,
        total: this.formData.projectCost,
        investment: this.formData.investment,
        startDate: this.formData.startDate,
        salaryDay: this.formData.salaryDay,
        cycle: this.formData.constructionCycle,
        address: this.formData.detailAddress,
        status: this.formData.projectStatus,
        typeId: this.formData.typeId,
        areaId: this.formData.areaId,
        leader: this.formData.leader,
        leaderTel: this.formData.leaderTel, //---项目负责人电话
        files: JSON.stringify(this.upLoadFile), //---项目合同附件
        pcName: this.formData.pcName.replace(/\s+/g, ''), //单位名称
        pcUscc: this.formData.pcUscc.replace(/\s+/g, ''), //建设方统一社会信用代码
        pbName: this.formData.pbName.replace(/\s+/g, ''), //施工方单位名称
        pbUscc: this.formData.pbUscc.replace(/\s+/g, ''), //施工方统一社会信用代码\
        managerName: this.formData.managerName,
        managerIdcard: this.formData.managerIdcard,
        managerTel: this.formData.managerTel,
        pcLeader: this.formData.pcLeader, //---建设方项目负责人
        pcLeaderTel: this.formData.pcLeaderTel, //---建设方项目负责人电话
        mgFiles: JSON.stringify(this.managerUpLoadFile), //项目经理资格证书
        licenseFiles: JSON.stringify(this.upLoadFileLicense), //施工许可证
        ordFiles: JSON.stringify(this.upLoadFileOrder), //开工令
        license: this.formData.license,
        pcIsValid:
          this.userType == 'PROJECT_ADMINISTRATOR' ||
          this.userType == 'LABOR_ADMINISTRATOR'
            ? Number(this.pcIsValid)
            : '',
        pbIsValid:
          this.userType == 'PROJECT_ADMINISTRATOR' ||
          this.userType == 'LABOR_ADMINISTRATOR'
            ? Number(this.pbIsValid)
            : '',
        constructLocation: this.formData.constructLocation,
        contractSignDate: this.formData.contractSignDate,
        appointJson: JSON.stringify(this.manUploadFiles),
      }
      // if(this.isWhUser()){
      data.isStateOwnedConstruction = this.formData.isStateOwnedConstruction
      // }
      this.axios({
        method: 'post',
        url: 'api-p/project/expand/edit',
        data: data,
      })
        .then((response) => {
          this.isSaveLoading = false
          if (!response.data.hasError) {
            this.$message({
              message: '保存成功',
              type: 'success',
            })
            setTimeout(() => {
              // this.$emit('isShow','save')
              this.goBackOne()
              // this.$router.push({
              //     path:"/home/monitorProjectManagement/projectDetail",
              //     name: "projectDetail",
              //     query: {
              //         projectId: this.projectId,
              //     }
              // });
              // this.$store.commit("CHANGE_SLIDER_NAME", {oldUrl:"/home/project/projectList",newUrl:this.$router.currentRoute.fullPath});
            }, 1500)
          } else {
            this.$message({
              type: 'error',
              message: response.data.errorMsg,
            })
            this.isSaveLoading = false
          }
        })
        .catch((error) => {
          this.$message.error('保存失败')
          this.isSaveLoading = false
        })
    },
    // 获取页面数据
    getData() {
      this.isSaveLoading = true
      this.axios({
        method: 'post',
        url: 'api-p/project/expand/initdata',
        data: { id: this.projectId },
      })
        .then((resp) => {
          if (!resp.data.hasError) {
            this.isSaveLoading = false
            // this.oldFormData =
            this.projectData = resp.data.result
            this.lon = this.projectData.lon
            this.lat = this.projectData.lat
            this.projectName = this.projectData.projectName
            this.formData.projectName = this.projectData.projectName
            this.formData.startDate = this.projectData.startDate
            this.formData.constructionCycle = this.projectData.cycle
            this.formData.projectStatus = this.projectData.status
            this.statusDesc = this.projectData.statusDesc
            this.status = this.projectData.status
            this.formData.industryId = this.projectData.industryId
            this.formData.investment = this.projectData.investment
            this.formData.projectCost = this.projectData.total
            this.formData.startDate = this.projectData.startDate
            this.formData.constructionCycle = this.projectData.cycle
            this.formData.typeId = this.projectData.typeId
            this.formData.detailAddress = this.projectData.address
            // this.areaId = [this.projectData.provinceId,this.projectData.cityId,this.projectData.countyId];
            this.areaId = this.projectData.areaList
            this.formData.areaId = this.projectData.areaId
            this.upLoadFile = this.projectData.contractFiles
            this.formData.leader = this.projectData.leader //---项目负责人
            this.formData.leaderTel = this.projectData.leaderTel //---项目负责人电话
            this.formData.pcName = this.projectData.pcName
            this.formData.pcUscc = this.projectData.pcUscc
            this.formData.pbName = this.projectData.pbName
            this.formData.pbUscc = this.projectData.pbUscc
            this.oldPbName = this.projectData.pbName
            this.oldPbUscc = this.projectData.pbUscc
            this.formData.pcLeader = this.projectData.pcLeader
            this.formData.pcLeaderTel = this.projectData.pcLeaderTel
            this.managerUpLoadFile = this.projectData.manFiles
            this.upLoadFileLicense = this.projectData.licenseFilesView || [] //施工许可证
            this.upLoadFileOrder = this.projectData.orFiles //开工令
            this.formData.managerIdcard = this.projectData.managerIdcard
            this.formData.managerName = this.projectData.managerName
            this.formData.managerTel = this.projectData.managerTel
            this.formData.license = this.projectData.license
            this.formData.salaryDay = this.projectData.salaryDay
            this.formData.constructLocation = this.projectData.constructLocation //施工地址
            this.formData.contractSignDate = this.projectData.contractSignDate
            this.manUploadFiles = this.projectData.appointFiles
            if (this.upLoadFile.length > 0) {
              for (var i = 0; i < this.upLoadFile.length; i++) {
                this.srcList.push(this.upLoadFile[i].url)
                this.oldSrcList.push(this.upLoadFile[i].url)
              }
            }
            if (this.managerUpLoadFile.length > 0) {
              for (var i = 0; i < this.managerUpLoadFile.length; i++) {
                this.managerSrcList.push(this.managerUpLoadFile[i].url)
                this.managerOldSrcList.push(this.managerUpLoadFile[i].url)
              }
            }
            if (this.upLoadFileOrder.length > 0) {
              for (var i = 0; i < this.upLoadFileOrder.length; i++) {
                this.srcListOrder.push(this.upLoadFileOrder[i].url)
                this.oldSrcListOrder.push(this.upLoadFileOrder[i].url)
              }
            }
            if (this.manUploadFiles.length > 0) {
              for (var i = 0; i < this.manUploadFiles.length; i++) {
                this.manFilesSrcList.push(this.manUploadFiles[i].url)
                this.manFilesOldSrcList.push(this.manUploadFiles[i].url)
              }
            }
            this.formData.isStateOwnedConstruction = this.projectData
              .isStateOwnedConstruction
              ? this.projectData.isStateOwnedConstruction
              : ''
            //武汉地区需求
            // if(!this.isWhUser()){
            //    delete this.formRules.isStateOwnedConstruction
            // }
            this.$nextTick(() => {
              this.$refs.formData.clearValidate()
            })
          } else {
            this.isSaveLoading = false
          }
        })
        .catch((resp) => {
          this.isSaveLoading = false
          this.$message.error('数据获取失败')
        })
    },
    //获取选中的区域最后一级id
    getAreaId() {
      this.formData.areaId = this.areaId[this.areaId.length - 1]
    },
    getLocation() {
      var that = this
      var map = new BMap.Map('allmap')

      function myFun(result) {
        var cityName = result.name
        map.setCenter(cityName)
        that.LocationPoint = cityName
      }
      var myCity = new BMap.LocalCity()
      myCity.get(myFun)
    },
    showMap() {
      this.isShowMap = true
      this.isShowBox = false
      var addressName = this.formData.detailAddress
      this.$nextTick(function () {
        // 详细地址获取焦点
        this.$refs.inputDetailAdr.focus()
        this.initMap()
        setTimeout(function () {
          if ($('.tangram-suggestion-main').length == 1) {
            $('#suggestId').val(addressName)
          }
        }, 50)
        $('#suggestId').val(addressName)
      })
    },
    hideMap() {
      var that = this
      setTimeout(function () {
        if (that.selectData == '1') {
          that.isShowMap = true
          that.selectData = ''
          that.isShowBox = false
        } else {
          that.isShowMap = false
          that.isShowBox = true
        }
      }, 500)
    },
    initMap() {
      var that = this
      // 百度地图API功能
      function G(id) {
        return document.getElementById(id)
      }

      var map = new BMap.Map('l-map')
      if (that.formData.detailAddress) {
        that.isShowMap = true
        this.isShowBox = false

        var point = new BMap.Point(that.lon, that.lat)

        map.centerAndZoom(point, 16)

        var mk = new BMap.Marker(point)
        map.addOverlay(mk)
        map.panTo(point)
      } else {
        var myGeo = new BMap.Geocoder()
        // 将地址解析结果显示在地图上,并调整地图视野
        myGeo.getPoint(
          that.LocationPoint,
          function (point) {
            if (point) {
              map.centerAndZoom(point, 16)

              var mk = new BMap.Marker(point)

              map.addOverlay(mk)
              map.panTo(point)
            } else {
              // alert("您选择地址没有解析到结果!");
            }
          },
          '北京市'
        )
      }
      //增加滚轮放大缩小
      map.enableScrollWheelZoom(true)

      //增加滚轮放大缩小
      var ac = new BMap.Autocomplete({
        //建立一个自动完成的对象
        input: 'suggestId',
        location: map,
      })

      ac.addEventListener('onhighlight', function (e) {
        // that.selectData = "1";
        //鼠标放在下拉列表上的事件
        var str = ''
        var _value = e.fromitem.value
        var value = ''
        if (e.fromitem.index > -1) {
          value =
            _value.province +
            _value.city +
            _value.district +
            _value.street +
            _value.business
        }
        str =
          'FromItem<br />index = ' + e.fromitem.index + '<br />value = ' + value

        value = ''
        if (e.toitem.index > -1) {
          _value = e.toitem.value
          value =
            _value.province +
            _value.city +
            _value.district +
            _value.street +
            _value.business
        }
        str +=
          '<br />ToItem<br />index = ' +
          e.toitem.index +
          '<br />value = ' +
          value
        G('searchResultPanel').innerHTML = str
      })

      var myValue
      ac.addEventListener('onconfirm', function (e) {
        that.selectData = '1'
        //鼠标点击下拉列表后的事件
        var _value = e.item.value
        myValue =
          _value.province +
          _value.city +
          _value.district +
          _value.street +
          _value.business
        G('searchResultPanel').innerHTML =
          'onconfirm<br />index = ' +
          e.item.index +
          '<br />myValue = ' +
          myValue
        that.formData.detailAddress = myValue
        setPlace()
      })

      function setPlace() {
        map.clearOverlays() //清除地图上所有覆盖物
        function myFun() {
          var pp = local.getResults().getPoi(0).point //获取第一个智能搜索的结果
          map.centerAndZoom(pp, 18)
          var marker = new BMap.Marker(pp)
          map.addOverlay(marker) //添加标注
          that.lon = pp.lng
          that.lat = pp.lat
          var geoc = new BMap.Geocoder()
        }
        var local = new BMap.LocalSearch(map, {
          //智能搜索
          onSearchComplete: myFun,
        })
        local.search(myValue)
      }
    },
    getSelecData(type) {
      var url
      if (type == 'PROJECT_INVESTMENT' || type == 'PROJECT_STATUS') {
        url = 'api-p/project/expand/findstatusbytype'
      } else {
        url = 'api-bs/base/dicitem/findbytype'
      }
      this.axios({
        method: 'post',
        url: url,
        data: { type: type },
      })
        .then((res) => {
          if (type == 'INDUSTRY') {
            this.industryId = res.data.result
          } else if (type == 'PROJECT_TYPE') {
            this.typeId = res.data.result
          } else if (type == 'PROJECT_INVESTMENT') {
            this.investment = res.data.result
          }
          // else if (type == "PROJECT_STATUS") {
          //     this.projectStatus = res.data.result;
          // }
        })
        .catch((error) => {
          this.$message({
            showClose: true,
            duration: 3000,
            message: '获取数据失败',
            type: 'error',
          })
        })
    },

    /**
     * @description: 改变图片地址
     */
    changeList(val) {
      this.srcList = val
    },
    /**
     * @description: 改变图片地址
     */
    changeSrcList(val) {
      this.managerSrcList = val
    },
    getFileListManager(val) {
      this.managerOldSrcList.push(val)
      this.managerSrcList.push(val)
    },
    getFileManager(val) {
      this.managerUpLoadFile = val
    },
    getFileList(val) {
      this.oldSrcList.push(val)
      this.srcList.push(val)
    },
    getFile(val) {
      this.upLoadFile = val
    },
    //施工许可证
    getFileListLicense(val) {
      this.oldSrcListLicense.push(val)
      this.srcListLicense.push(val)
    },
    getFileLicense(val) {
      this.upLoadFileLicense = val
    },
    // 开工令
    getFileListOrder(val) {
      this.oldSrcListOrder.push(val)
      this.srcListOrder.push(val)
    },
    getFileOrder(val) {
      this.upLoadFileOrder = val
    },
    // 项目经理任命书
    getFileListManFiles(val) {
      this.manFilesOldSrcList.push(val)
      this.manFilesSrcList.push(val)
    },
    getFileManFiles(val) {
      this.manUploadFiles = val
    },
    validProName(rule, value, callback) {
      //当项目名称和原来项目名称不同时才调用校验接口
      if (this.formData.projectName !== this.projectName) {
        this.axios({
          method: 'post',
          url: 'api-p/project/expand/validatename',
          data: {
            name: this.formData.projectName,
            id: this.projectId,
          },
        }).then((resp) => {
          if (resp.data.hasError) {
            //     this.$message({
            //     showClose: true,
            //     duration: 3000,
            //     message: resp.data.errorMsg,
            //     type: "error"
            //     });
            this.hasSameName = true
            callback(new Error(resp.data.errorMsg))
          } else {
            this.hasSameName = false
            callback()
          }
        })
        // .catch(resp => {
        //     callback(new Error("验证失败"));
        //     console.log("请求失败");
        // });
      } else {
        callback()
      }
    },
    validUsccAndCompany(companyName, uscc) {
      if (companyName && uscc) {
        this.axios({
          method: 'post',
          url: 'api-c/companyaudit/base/validcompanybyproject',
          data: {
            name: companyName.replace(/\s+/g, ''),
            uscc: uscc.replace(/\s+/g, ''),
          },
        })
          .then((res) => {
            if (!res.data.hasError) {
              this.$message({
                message: '已通过校验',
                type: 'success',
              })
            } else {
              if (res.data.errorCode == 'unmatched') {
                this.$message({
                  message: '未通过校验，请确认信息是否准确',
                  type: 'warning',
                })
              }
            }
          })
          .catch((error) => {
            this.$message.error('验证失败')
          })
      }
    },
    getIsNeed() {
      return this.axios({
        method: 'post',
        url: 'api-m/fieldconfig/base/getbymaintype',
        data: {
          mainType: 'PROJECT_BUILD',
        },
      })
        .then((response) => {
          if (!response.data.hasError) {
            this.list = response.data.result
            // this.$set(this.listObject,'isNeedManagerTel',element.isNeed)
            this.list.forEach((element) => {
              if (element.code == 'license') {
                //施工许可证
                this.isNeedLicense = element.isNeed
              } else if (element.code == 'ordFiles') {
                //开工令附件
                this.isNeedOrdFiles = element.isNeed
              } else if (element.code == 'isStateOwnedConstruction') {
                //是否国企施工项目
                this.isNeedIsStateOwned = element.isNeed
              } else if (element.code == 'contractSignDate') {
                //合同签订日
                this.isNeedContractSignDate = element.isNeed
              } else if (element.code == 'licenseFiles') {
                //武汉施工许可证
                this.isNeedLicenseFiles = element.isNeed
              } else if (element.code == 'files') {
                //合同附件
                this.isNeedUpLoadFile = element.isNeed
              } else if (element.code == 'managerName') {
                //项目经理姓名
                this.isNeedManagerName = element.isNeed
              } else if (element.code == 'managerIdcard') {
                //项目经理身份证号managerIdcard
                this.isNeedManagerIdcard = element.isNeed
              } else if (element.code == 'managerTel') {
                //项目经理手机号码
                this.isNeedManagerTel = element.isNeed
              } else if (element.code == 'mgFiles') {
                //项目经理资格证书
                this.isNeedMgFiles = element.isNeed
              } else if (element.code == 'appointJson') {
                //项目经理任命文件
                this.isAppointJson = element.isNeed
              } else if (element.code == 'address') {
                this.isNeedAddress = element.isNeed
              } else if (element.code == 'constructLocation') {
                this.isNeedConstructLocation = element.isNeed
              } else if (element.code == 'pcLeader') {
                this.isNeedPcLeader = element.isNeed
              } else if (element.code == 'pcLeaderTel') {
                this.isNeedPcLeaderTel = element.isNeed
              } else if (element.code == 'leader') {
                this.isNeedLeader = element.isNeed
              } else if (element.code == 'leaderTel') {
                this.isNeedLeaderTel = element.isNeed
              }
            })
          } else {
            this.$message.error(response.data.errorMsg)
          }
        })
        .catch((error) => {
          if (error.response) {
            this.$message.error(error.response.data)
          }
        })
    },
  },
  watch: {
    managerUpLoadFile(val) {
      if (val && val.length > 0) {
        this.$refs.formData.clearValidate('managerUpLoadFile')
      }
    },
    // "formData.detailAddress": {
    //     handler(newVal, oldVal) {
    //         if (oldVal) {
    //             if (newVal != oldVal) {
    //             // this.lon = "";
    //             // this.lat = ""
    //             }
    //         }
    //     },
    // deep: true
    // },
    //  "formData.areaId": {
    //     handler(newVal, oldVal) {
    //         if (oldVal) {
    //             if (newVal != oldVal) {
    //             if(this.loginType == 'JC'){
    //                     this.$message({
    //                         type: 'warning',
    //                         message:'修改后原有区域将无法查看该项目，请知悉；'
    //                     })
    //                 }
    //             }
    //         }
    //     }
    // },
    // "formData.industryId": {
    //     handler(newVal, oldVal) {
    //         if (oldVal) {
    //             if (newVal != oldVal) {
    //             if(this.loginType == 'JC'){
    //                     this.$message({
    //                         type: 'warning',
    //                         message:'修改后原有行业主管将无法查看该项目，请知悉；'
    //                     })
    //                 }
    //             }
    //         }
    //     }
    // },
    // "formData.projectCost": {
    //     handler(newVal, oldVal) {
    //         if (oldVal) {
    //             if (newVal != oldVal) {
    //             if(this.loginType == 'JC'){
    //                     this.$message({
    //                         type: 'warning',
    //                         message:'修改后将影响专户应拨付金额、保证金应缴金额以及相关预警、信用评分，请知悉；'
    //                     })
    //                 }
    //             }
    //         }
    //     }
    // },
    // "formData.startDate": {
    //     handler(newVal, oldVal) {
    //         if (oldVal) {
    //             if (newVal != oldVal) {
    //             if(this.loginType == 'JC'){
    //                     this.$message({
    //                         type: 'warning',
    //                         message:'修改后将影响与开工日期有关的信用指标评分、拨付计划以及预警，请知悉；'
    //                     })
    //                 }
    //             }
    //         }
    //     }
    // },
    // "formData.projectStatus": {
    //     handler(newVal, oldVal) {
    //         if (oldVal) {
    //             if (newVal != oldVal) {
    //             if(this.loginType == 'JC'){
    // if(newVal == 'STARTED'){
    //         this.$message({
    //             type: 'warning',
    //             message:'项目开工后将按照政策产生预警，并进行信用评分，请知悉；'
    //         })
    //     }
    // if(newVal == 'STOPPED'||newVal == 'COMPLETED'){
    //         this.$message({
    //             type: 'warning',
    //             message:'项目停工/竣工后将停止预警，请知悉；'
    //         })
    //     }
    //     if(newVal == 'NOT_STARTED'){
    //         this.$message({
    //             type: 'warning',
    //             message:'项目未开工，将停止预警，请知悉；'
    //         })
    //     }
    //                 }
    //             }
    //         }
    //     }
    // },
  },
}
</script>

<style lang="less" scoped>
.editTips {
  line-height: 20px;
  font-size: 14px;
  color: #666;
  margin-top: 10px;
}
.container {
  .mainCon {
    padding: 24px 24px 40px;
    .infoTitle {
      font-size: 16px;
      padding: 16px 24px;
      background: #f5f7fb;
      margin-bottom: 24px;
      color: #333;
      font-weight: 700;
    }
    .proInputWidth {
      width: 75%;
    }
    .minInputWidth {
      width: 35%;
      margin-right: 8px;
    }
  }
  .uploadBox {
    position: relative;
    .uploadImg {
      width: 96px;
      height: 36px;
      color: #009588;
      border: 1px solid #009588;
      line-height: 10px;
    }
    .uploadImgState {
      font-size: 14px;
      color: #999999;
      margin-left: 12px;
    }
    .upLoadDom {
      position: absolute;
      top: 0;
      left: 0;
      opacity: 0;
      input {
        width: 100px;
        height: 36px;
        cursor: pointer;
      }
    }
  }
  .imgStyle {
    padding-left: 100px;
    margin-bottom: 24px;
    li {
      position: relative;
      margin-right: 20px;
      margin-top: 10px;
      i {
        position: absolute;
        right: -6px;
        top: -10px;
        font-size: 20px;
      }
    }
  }
  .manUploads {
    /deep/ .el-form-item__label {
      line-height: normal !important;
    }
  }
}
.mainConeditTips {
  top: 220px !important;
}
@media screen and (min-width: 1280px) and (max-width: 1440px) {
  .el-form-item {
    margin-bottom: 30px;
  }
}
</style>
